<?php

namespace common\models;

use Yii;
use yii\behaviors\TimestampBehavior;

/**
 * This is the model class for table "{{%img}}".
 *
 * @property string $id
 * @property string $type
 * @property integer $type_id
 * @property string $img_big
 * @property string $img_small
 * @property integer $status
 * @property string $created_at
 * @property string $updated_at
 * @property string $res1
 * @property string $res2
 * @property string $res3
 */
class Img extends \yii\db\ActiveRecord   //图像表  人物头像等
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%img}}';
    }
    public function behaviors()
    {
        return [
            'class' => TimestampBehavior::className(),
        ];
    }
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['uid','type', 'img_big', 'img_small'], 'required'],
            [['type', 'type_id', 'status'], 'integer'],
            [['img_big', 'img_small', 'res1', 'res2', 'res3'], 'string', 'max' => 80]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'uid' => 'UID',
            'type' => 'Type',
            'type_id' => 'type_id',
            'img_big' => 'Img Big',
            'img_small' => 'Img Small',
            'status' => 'Status',   //0无效（没有上传图片），2位准备（上传图片未提交活动），1 有效（上传并提交活动）
            'created_at' => 'Create At',
            'updated_at' => 'Update At',
            'res1' => 'Res1',
            'res2' => 'Res2',
            'res3' => 'Res3',
        ];
    }
}
